<?php
(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
/*
	[天生创想] (C)2008-2011 515158 Inc.
	This is NOT a freeware, use is subject to license terms
    URL:http://www.515158.com/
*/


get_config_keytable("date_workdate_edit");
empty($do) && $do = 'list';
if ($do == 'edit') {
	$id = getGP('id','G','int');
	$workdate = $db->fetch_one_array("SELECT * FROM ".DB_TABLEPRE."workdate  WHERE id = '$id'");
	include_once('template/edit.php');

} elseif ($do == 'save') {
	
	$savetype = getGP('savetype','P');
	$id = getGP('id','P','int');
	//$otype = getGP('otype','P');
	//$title = getGP('title','P');
	//$startdate = getGP('startdate','P')." ".getGP('starth','P').":".getGP('starti','P').":00";
	//$enddate = getGP('enddate','P')." ".getGP('endh','P').":".getGP('endi','P').":00";
	//$content = getGP('content','P');
	$date = get_date('Y-m-d h:i:s',PHP_TIME);
	//$type = getGP('type','P');
	//$uid=$_USER->id;
	$workdate = array(
		'completiondate' => $date
	);
	update_db('workdate',$workdate, array('id' => $id));
	$content=$title.get_inc_log(1).$otype.get_inc_log(1).$startdate.get_inc_log(1).$enddate.get_inc_log(1).$content.get_inc_log(1).$type;
	$title='编辑日程信息';
	get_oa_log_dbadd($id,$content,$title,10,$_USER->id);
	goto_page('admin.php?ac=index&fileurl=workdate&type=1');
	

}

?>